import { initMixin } from "./init";
import { stateMixin } from "./state";
import { renderMixin } from "./render";
import { eventsMixin } from "./events";
import { lifecycleMixin } from "./lifecycle";
import { warn } from "../util/index";

function Vue(options) {
  if (process.env.NODE_ENV !== "production" && !(this instanceof Vue)) {
    warn("Vue is a constructor and should be called with the `new` keyword");
  }
  // 执行了 _init方法
  this._init(options);
}

// 实例方法的初始化
initMixin(Vue); // 混入了 _init 方法
stateMixin(Vue); // $set/$del/$watch
eventsMixin(Vue); // $on/$emit/$off/$once
lifecycleMixin(Vue); // _update/$forceUpdate/$destroy
renderMixin(Vue); // $nextTick/_render

export default Vue;
